package core
{
import flash.utils.Dictionary;
/**
 * @author daichangxin
 */
public class StrategyManager
{
	private static var _instance:StrategyManager;
	
	private var _dic:Dictionary;
	
	public function StrategyManager()
	{
		if (_instance == null)
		{
			_instance = this;
			_dic = new Dictionary();
		}
	}
	
	public function registerStrategy(name:String, strategy:IStrategy):void
	{
		_dic[name] = strategy;
	}
	
	public function getStrategy(name:String):IStrategy
	{
		return _dic[name];
	}
	
	public static function getInstance():StrategyManager
	{
		if (_instance == null)
		{
			_instance = new StrategyManager();
		}
		return _instance;
	}
}
}
